const base = require('./webpack.common.js');
const { merge } = require('webpack-merge');
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')


const path = require('path');

const prod_config = {
    mode: 'production',
    output: {
        filename: 'prod_bundle.[hash:8].js',
        path: path.join(__dirname, 'dist')
    },
    stats: "errors-only",
    module: {
        rules: []
    },
    plugins: [
        new CleanWebpackPlugin(),       
        new CopyWebpackPlugin([
            'public/**'
            // 'public'
        ])
    ]
};

module.exports = merge(base, prod_config);